package com.syys.listener;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;

import java.util.Arrays;

/**
 * @Classname MyExecutionListener
 * @Description TODO
 * @Date 2021/6/1 13:52
 * @Created by ys
 */
public class MyExecutionListener implements ExecutionListener {

    @Override
    public void notify(DelegateExecution delegateExecution) throws Exception {
        String assigneeList = String.valueOf(delegateExecution.getVariable("assigneeList"));
        if (assigneeList != null) {
            // 根据逗号分割并以数组形式重新设置进去
            delegateExecution.setVariable("assigneeList", Arrays.asList(assigneeList.split(",")));
        }
    }

}